package com.px.chapter_Dec_1.textt;

public class Kids extends Mankind {
    private int yearsOld;

    public Kids(int sex, int salary, int yearsOld) {
        super(sex, salary);
        this.yearsOld = yearsOld;
    }

    public Kids() {
    }

    public Kids(int yearsOld) {
        this.yearsOld = yearsOld;
    }

    public void printAge(){
        System.out.println(yearsOld);
    }

    public int getYearsOld() {
        return yearsOld;
    }

    public void setYearsOld(int yearsOld) {
        this.yearsOld = yearsOld;
    }

    @Override
    public void ccc() {
        System.out.println("重新子类");
        super.ccc();
    }

    public static void main(String[] args) {
        Kids someKid=new Kids(0,0,18);
        someKid.printAge();
        someKid.manOrWorman();
        someKid.ccc();
        Mankind iii=new Mankind();
        iii.ccc();
        Mankind ii=new Kids();
        ii.ccc();

    }

}
